package day16.KeJian;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressDemo {
    public static void main(String[] args) throws UnknownHostException {
        //InetAddress[] add1 = InetAddress.getAllByName("itheima");
        InetAddress[] add = InetAddress.getAllByName("127.0.0.1");
        //public String getHostName();
        //String name = add.getHostName();
        //public String getHostAddress();//public String getHostAddress()：返回文本显示中的IP地址字符串
        //String ip = add.getHostAddress();

        //System.out.println("主机名：" + name);
        //System.out.println("IP地址：" + ip);
    }
}
